package cn.itsource.ymcc.client;

import cn.itsource.ymcc.client.fallback.CourseUserLearnFeignClientFallbackFactory;
import cn.itsource.ymcc.domain.CourseUserLearn;
import cn.itsource.ymcc.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(value = "service-course",fallbackFactory = CourseUserLearnFeignClientFallbackFactory.class)
@RequestMapping("/courseUserLearn")
public interface CourseUserLearnFeignClient {

    @RequestMapping(value="/save",method= RequestMethod.POST)
    JSONResult saveOrUpdate(@RequestBody CourseUserLearn courseUserLearn);

    @RequestMapping(value="/selectForUser/{courseId}",method= RequestMethod.GET)
    JSONResult selectForUser( @PathVariable("courseId")Long courseId);
}
